import java.time.DayOfWeek;
import java.time.LocalDate;
import java.time.Month;

/*
 * @Author: qianmingtian
 * @Date: 2020-05-25 11:15:09
 * @LastEditors: qianmingtian
 * @LastEditTime: 2020-06-25 12:01:02
 * @FilePath: \qianmingtian.github.io\code\java\Calendar.java
 */
public class Calendar {
    public static void main(String[] args) {
        LocalDate date = LocalDate.now();
        int month = date.getMonthValue();
        //  month =6;
        int today = date.getDayOfMonth();

        date = date.minusDays(today - 1);
        DayOfWeek weekday = date.getDayOfWeek();
        int value = weekday.getValue();

        System.out.println("Mon Tue Wed Thu Fri Stat Sun");
        for( int i = 1;i< value;i++){
            System.out.print("    ");
        }

        while(date.getMonthValue()==month){
            System.out.printf("%3d",date.getDayOfMonth());
            if(date.getDayOfMonth()==today){
                System.out.print("*");
            }else{
                System.out.print(" ");
            }
            date = date.plusDays(1);
            if (date.getDayOfWeek().getValue() ==1) System.out.println();
        }

        
    }
}/*
  * @Author: qianmingtian
  * 
  * @Date: 2020-05-25 11:15:09
  * 
  * @LastEditors: qianmingtian
  * 
  * @LastEditTime: 2020-05-25 11:15:09
  * 
  * @FilePath: \qianmingtian.github.io\code\java\Calendar.java
  */
